﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommonConfig;
using WXEntity;

namespace WXServer
{
    class BaseServer
    {
        BaseServerImplement baseServerImplement = new BaseServerImplement();
        public ResultEntity Register(RequestEntity requestEntity)
        {
            ResultEntity resultEntity = new ResultEntity();
            try
            {
               string msg  = baseServerImplement.Register(requestEntity,ref resultEntity);
            }
            catch (Exception ex)
            {
                resultEntity.Code = ErrorCode.RequestFail;
                resultEntity.Msg = ex.Message;
                LogHelper.Debug(ex);
            }
            return resultEntity;
        }

        public ResultEntity Login(RequestEntity requestEntity)
        {
            ResultEntity resultEntity = new ResultEntity();
            try
            {
                string msg = baseServerImplement.Login(requestEntity, ref resultEntity);
            }
            catch (Exception ex)
            {
                resultEntity.Code = ErrorCode.RequestFail;
                resultEntity.Msg = ex.Message;
                LogHelper.Debug(ex);
            }
            return resultEntity;
        }
    }
}
